<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddRetryAndRetryDateColumnToUserLoanRequests extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('user_loan_requests', function (Blueprint $table) {
            $table->date('retry_date')->nullable()->comment('重试日期')->after('status');
            $table->unsignedTinyInteger('retry')->default(0)->comment('重试状态：0不需要重试 1需要重试 2已经重试')->after('status');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('user_loan_requests', function (Blueprint $table) {
            $table->dropColumn('retry_date');
            $table->dropColumn('retry');
        });
    }
}
